package com.jt.assistant.utils

import android.os.Environment
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import java.io.File

object ImageUtil {
    fun getPath(): String? {
        val path = Environment.getDownloadCacheDirectory().toString() + "/image/"
        val file = File(path)
        return if (file.mkdirs()) {
            path
        } else path
    }

    fun deleteCompressPic(PictureList: List<String?>) =
        GlobalScope.launch {
            for (pic in PictureList) {
                val file = File(pic)
                if (file.exists()) file.delete()
            }
        }

}